﻿namespace EasyWeb
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Transactions;

    internal static partial class EWHelpers
    {
        public static class Data
        {
            public static TransactionScope BeginTransaction(TransactionScopeOption option = TransactionScopeOption.Required, IsolationLevel level = IsolationLevel.ReadCommitted)
            {
                EWDebug.IsDefinedEnum(option, "option");
                EWDebug.IsDefinedEnum(level, "level");

                return new TransactionScope(option, new TransactionOptions() { IsolationLevel = level }, TransactionScopeAsyncFlowOption.Enabled);
            }
        }
    }
}
